Returns all or a portion of the contents of an rdoColumn object with a data type of rdTypeLONGVARBINARY or rdTypeLONGVARCHAR.
Syntax
varname = object ! column.GetChunk(numbytes)
The GetChunk method syntax has these parts:
Part | Description |
varname | The name of a Variant that receives the data from the rdoColumn object named by column. |
object | An object expression that evaluates to an rdoResultset object containing the rdoColumns collection. |
column | An object expression that evaluates to an rdoColumn object whose ChunkRequired property is True. |
numbytes | A numeric expression that is the number of bytes you want to return. |
Remarks
Chunk data columns are designed to store binary or text values that can range in size from a few characters to over 1.2GB and are stored in the database on successive data pages. In most cases, chunk data cannot be managed with a single operation so you must use the chunk methods to save and write data a piece at a time. If the ChunkRequired property is True for a column, you should use the GetChunk and AppendChunk methods to manipulate column data. The BindThreshold property determines the largest size block that is automatically bound and precludes the need to use the chunk methods.
If the ChunkRequired property is True for a column, you must use the GetChunk method to retrieve the data. The GetChunk method moves a portion of the data from a chunk column to a variable. The total number of bytes in the column is determined by executing the ColumnSize method.
The GetChunk method is used iteratively, copying column data to a variable, one segment or chunk at a time. The chunk size is set by numbytes. The starting point of the copy operation is initially 0, which causes data to be copied from the first byte of the column being read. Subsequent calls to GetChunk get data from the first position after the previously read chunk.
The bytes returned by GetChunk are assigned to varname. Due to memory requirements for the returned data and temporary storage, numbytes might be limited, but with 32-bit systems this limitation is over 1.2GB, or more practically the memory and disk capacity of your virtual memory system.
If numbytes is greater than the number of bytes in the column, the actual number of bytes in the column is returned. After assigning the results of GetChunk to a Variant variable, you can use the Len function to determine the number of bytes returned.
Use the AppendChunk method to write successive blocks of data to the column and GetChunk to extract data from the column. Certain operations (copying, for example) involve temporary strings. If string space is limited, you may need to work with smaller segments of a chunk column instead of the entire column.
Use the BindThreshold property to specify the largest column size that will be automatically bound.
Note Because the size of a chunk data column can exceed 1.2GB, you should assign the value returned by the GetChunk method to a variable large enough to store the data returned based on the size returned by the ColumnSize method.